#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using UnityEngine;

namespace EntityKit.Runtime
{
    public static partial class AsyncTriggerExtensions
    {
        public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this GameObject gameObject)
        {
            if (gameObject == null)
                throw new System.ArgumentNullException(nameof(gameObject));
                
            return gameObject.GetOrAddComponent<AsyncDestroyTrigger>();
        }

        public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this Component component)
        {
            if (component == null)
                throw new System.ArgumentNullException(nameof(component));
                
            return component.gameObject.GetAsyncDestroyTrigger();
        }
    }
}